'''
Created on 17/10/2011

@author: nacho
'''

from planificator import Planificator

class Priority(Planificator):
    '''
    classdocs
    '''


    def __init__(self,time):
        '''
        Constructor
        '''
        self.timer=time
     

        
    def reschedule(self, scheduler, cpu):
 
        pid= scheduler.calculatePriority()
        scheduler.runPCB(pid, cpu)
         
    def click(self,so,readyQ):
        
        self.timer.click(so,readyQ)   
        
    def choosePidToLoad(self, so):
        
        so.mostPriority()
        
        
    def deserveMemory(self, pid, so):
        
        return so.hasMorePriorityThanLesserInMemory(pid)
         
         
         
         
         
